import { createRouter, createWebHashHistory } from "vue-router";
import Manager from '../views/Manager.vue'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Empty from '../components/Empty.vue'
import CensorFile from '../views/CensorFile.vue'
import Recycle from '../views/Recycle.vue'
import SafeCenter from '../views/SafeCenter.vue'
import Setting from '../views/Setting.vue'
import Message from '../views/Message.vue'
import Share from '../views/Share.vue'
import Register from '../views/Register.vue'
// import About from '../views/About.vue'
// import List from '../views/List.vue'
// import Detail from '../views/Detail.vue'

const routes = [
    {
        path: '/',
        redirect: '/manager'
    },
    {
        path: '/manager',
        name: 'Manager',
        component: Manager,
        children: [
            { path: '', name: 'Home', component: Home },
            {
                path: 'share', name: 'Share', component: Share,
                children: [
                    { path: 'my', name: 'MyShare', component: () => import('@/views/shareViews/MyShare.vue') },
                    { path: 'history', name: 'HistoryShare', component: () => import('@/views/shareViews/HistoryShare.vue') }
                ]
            },
            {
                path: 'recycle', name: 'Recycle', component: Recycle,
                children: [
                    { path: 'recover', name: 'Recover', component: Empty }
                ]
            },
            { path: 'message', name: 'Message', component: Message },
            { path: 'empty', name: 'Empty', component: Empty },
        ]
    },
    {
        path: '/censorfile', name: 'CensorFile', redirect: '/censorfile/openfile', component: ()=> import('@/views/CensorFile.vue'),
        children: [
            { path: 'openfile', name: 'OpenFile', component: ()=> import('@/views/fileviews/OpenFile.vue') },
            { path: 'newfile', name: 'NewFile', component: ()=>import('@/views/fileviews/NewFile.vue') },
            { path: 'mycollection', name: 'MyCollection', component: ()=>import('@/views/homeViews/MyCollections.vue') }
        ]
    },
    {
        path: '/safecenter',
        name: SafeCenter,
        component: () => import('@/views/SafeCenter.vue')
    },
    {
        path: '/setting',
        name: Setting,
        component: () => import('@/views/Setting.vue')
    },
    {
        path: '/login',
        name: Login,
        component: Login
    },
    {
        path: '/register',
        name: Register,
        component: Register
    }

]

const router = createRouter({
    history: createWebHashHistory(import.meta.env.BASE_URL),
    routes
})

export default router

